package org.millioncall.yueyoga.admin.dao;

import java.util.List;
import java.util.Map;

import org.millioncall.openplatform.common.PaginatedList;
import org.millioncall.yueyoga.admin.model.AviatorExpression;
import org.millioncall.yueyoga.admin.model.HomePageLiftClub;
import org.millioncall.yueyoga.admin.model.LiftClub;
import org.millioncall.yueyoga.admin.model.LiftClubAdvance;
import org.millioncall.yueyoga.admin.model.LiftClubRecord;
import org.millioncall.yueyoga.admin.model.MemberClub;
import org.millioncall.yueyoga.admin.model.MemberLiftClub;

public interface LiftClubDAO {
	/**
	 * 查询近期的几个活动
	 * 
	 * @param n
	 * @return
	 */
	public List<HomePageLiftClub> findLastLiftClubs(int n, String organizationId);

	public PaginatedList<LiftClub> findInPage(int start, int limit,
			String[] paramNames, String[] paramValues);

	public PaginatedList<LiftClub> findInPage(int start, int limit);

	public int deleteByIds(String[] ids);

	public LiftClub findById(Integer id);

	public int update(LiftClub liftClub);

	public int save(LiftClub liftClub);

	public PaginatedList<LiftClub> findPage(int start, int limit,
			Map<String, Object> map);

	public int addLiftClub(Map<String, Object> map);

	public int updateLiftClub(Map<String, Object> map);

	public int deleteByLiftClubId(List<Integer> Ids);

	public LiftClub selectById(Integer id);

	public List<LiftClub> findLiftClubAll();

	public List<MemberClub> findLiftClubId(Integer id);

	public PaginatedList<LiftClub> findLiftClubById(int start, int limit,
			Integer id);
	
	public boolean addMemberToLiftClub(Map<String, Object> map);
	
	public MemberLiftClub findLiftClubMember(MemberLiftClub mem);
	
	public boolean deleteMemberFromLiftClub(MemberLiftClub mem);

	public PaginatedList<LiftClubRecord> findLiftClubsByCdts(int start,
			int limit, Map<String, Object> map);

	public LiftClub findLiftClubByCdts(Map<String, Object> map);
	
	/**
	 * 查询所有符合aviator表达式的活动
	 * 
	 * @param expression
	 * @param params
	 * @param start
	 * @param limit
	 * @return
	 */
	public List<LiftClubAdvance> getAllLiftClubsWithAviator(Map<String, Object> params,
			AviatorExpression expression, Map<String, Object> aviatorParams,
			int limit);

}